package com.ruoyi.project.custom.mapper;

import com.ruoyi.project.custom.domain.CustomInfo;
import com.ruoyi.project.custom.domain.vo.CustomAgreementVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 【请填写功能名称】Mapper接口
 * 
 * @author ruoyi
 * @date 2024-06-26
 */
public interface CustomInfoMapper 
{
    /**
     * 查询【客户信息】详情
     * 
     * @param id
     * @return
     */
    public CustomInfo selectCustomInfoById(String id);

    /**
     * 查询我的客户
     * @param customInfo
     * @return
     */
    public List<CustomInfo> selectCustomInfoList(CustomInfo customInfo);

    /**
     * 查询公海客户
     * @param customInfo
     * @return
     */
    public List<CustomInfo> selectNotAllocatedCustomList(CustomInfo customInfo);

    /**
     * 查询我的签约客户
     * @return
     */
    public List<CustomInfo> selectMySignedCustomList(CustomInfo customInfo);

    public List<CustomAgreementVo> selectCustomAgreementList();

    CustomInfo selectCustomByName(@Param("cusname") String cusname);

    int selectMyCustomCount(CustomInfo customInfo);

    /**
     * 查询是否已使用指定的客户分组
     * @param groupId
     * @return
     */
    public int checkCustomExistGroup(Long groupId);

    /**
     * 查询是否存在相同的客户名称
     * @param cusname
     * @return
     */
    public CustomInfo checkCustomNameUnique(@Param("cusname") String cusname);

    List<CustomInfo> selectOperatorShop(CustomInfo customInfo);

    List<CustomInfo> selectLeaderShop(CustomInfo customInfo);

    List<CustomInfo> selectShopAccordOperator(CustomInfo customInfo);

    List<CustomInfo> selectOperationSummaryInitData(@Param("operStartDate") Date operStartDate, @Param("operEndDate") Date operEndDate);

    /**
     * 新增【客户信息】
     * 
     * @param customInfo 【请填写功能名称】
     * @return 结果
     */
    public int insertCustomInfo(CustomInfo customInfo);

    /**
     * 修改【客户信息】
     * 
     * @param customInfo 【请填写功能名称】
     * @return 结果
     */
    public int updateCustomInfo(CustomInfo customInfo);

    int updateCustomOperStatus(CustomInfo customInfo);

    /**
     * 删除【客户信息】
     * 
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    public int deleteCustomInfoById(String id);

    /**
     * 批量删除【客户信息】
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCustomInfoByIds(String[] ids);
}
